/**
 * REFERRAL - AngularJS WebApp Theme
 * version 1.0.0
 */
"use strict";

if (!String.prototype.format) {
    String.prototype.format = function() {
        var formatted = this;
        for (var i = 0; i < arguments.length; i++) {
            var regexp = new RegExp("\\{" + i + "\\}", "gi");
            formatted = formatted.replace(regexp, arguments[i]);
        }
        return formatted;
    };
}

function isSmartDevice($window) {
    // adapted from http://detectmobilebrowsers.com
    var ua = $window["navigator"]["userAgent"] || $window["navigator"]["vendor"] || $window["opera"];
    // checks for iOs, Android, Blackberry, Opera Mini, and Windows mobile devices
    return /iPhone|iPod|iPad|Silk|Android|BlackBerry|Opera Mini|IEMobile/.test(ua);
}